package recipese.dao;

import javax.persistence.EntityManager;
import javax.persistence.Query;

import recipese.bean.ShareRecipe;


public class ShareRecipeDao extends JpaDao<ShareRecipe> {

	@Override
	public Class<ShareRecipe> getEntityClass() {
		return ShareRecipe.class;
	}
	
	public void deleteByRecipeId(String recipeId) {
		final EntityManager entityManager = getEntityManager();
		final Query query = entityManager.createQuery("delete from ShareRecipe i where i.recipeId = :recipeId");
		query.setParameter("recipeId", recipeId);
		query.executeUpdate();
	}

}
